package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 *
 * </p>
 *
 * @author cnswhy
 * @since 2020-12-22
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_photos")
@ApiModel(value = "CustomerPhotos", description = "")
@AllArgsConstructor
public class CustomerPhotos extends Entity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("customer_id")
    @Excel(name = "")
    private Long customerId;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "img_name", condition = LIKE)
    @Excel(name = "")
    private String imgName;

    @ApiModelProperty(value = "")
    @Length(max = 500, message = "长度不能超过500")
    @TableField(value = "img_path", condition = LIKE)
    @Excel(name = "")
    private String imgPath;

    @ApiModelProperty(value = "")
    @Length(max = 1, message = "长度不能超过1")
    @TableField(value = "img_type", condition = LIKE)
    @Excel(name = "")
    private String imgType;


    @Builder
    public CustomerPhotos(LocalDateTime createTime, LocalDateTime updateTime,
                          Long customerId, String imgName, String imgPath, String imgType, Long id) {
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.customerId = customerId;
        this.imgName = imgName;
        this.imgPath = imgPath;
        this.imgType = imgType;
        this.id = id;
    }

}
